
<%@page import="com.ecable.bean.ProfileTO"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%
	ProfileTO p;
%>

<%
	p = (ProfileTO) session.getAttribute("p");
%>

<html>
	<head>

		<script language="JavaScript"
			src="<%=request.getContextPath()
					+ "/scripts/gen_validatorv31.js"%>"
			type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
			function DistChange()
			{
			var state = document.getElementById('state').value;
			alert(state);
			window.location.href="./ViewRegVillageDistrictAction?sname="+state;
			}
						
			</script>
		<script type="text/javascript">
			
		function VillageChange()
		{
		
		var district=document.getElementById('district').value;
		var state = document.getElementById('stname').value;
		<!--alert(state);-->
		
		if(district=="")
		alert(district);
		else{
		
		window.location.href="./ViewRegVillageOperators?dname="+district+"&sname="+state;
		}
		}
		

	</script>





	</head>
	<body>
		<jsp:include page="Header.jsp"></jsp:include>

		<center>
			<b><h4>
					Contact Details
				</h4> </b>
		</center>

		<form action="./RegisterAction" method='post' name="register">


			<table cellspacing=2 align="center" bgcolor="#87CEEB">

				<tr>
					<td align='right'>
						<b>StateName :</b>
					</td>
					<td>
						<select name="state" id="select"
							onchange="javascript:if(document.register.state.value==''){alert('Select Any State');} else{ location.href='./ViewRegVillageDistrictAction?sname='+document.register.state.value;}">
							<c:choose>
								<c:when test="${requestScope.statename ne null}">
									<option value="${requestScope.statename}">
										${requestScope.statename}
									</option>
								</c:when>
								<c:otherwise>
									<option value="">
										--SELECT--
									</option>
									<c:if test="${not empty villstate}">
										<c:forEach var="State" items="${villstate}">
											<option value="${State.sname}">
												${State.sname}
											</option>
										</c:forEach>
									</c:if>
								</c:otherwise>
							</c:choose>

						</select>
						<input type="hidden" value="${requestScope.statename }"
							name="stname">
				<tr>
					<td align='right'>
						<b>DistrictName :</b>
					</td>
					<td>
						<select name="district" id="select"
							onchange=" return VillageChange();">
							<c:choose>
								<c:when test="${requestScope.districtname ne null}">
									<option value="${requestScope.districtname}">
										${requestScope.districtname}
									</option>
								</c:when>
								<c:otherwise>
									<option value="">
										--SELECT--
									</option>
								</c:otherwise>
							</c:choose>



							<c:if test="${not empty dist}">
								<c:forEach var="State" items="${dist}">
									<option value="${State.dname}">
										${State.dname}
									</option>
								</c:forEach>
							</c:if>
						</select>
				<tr>
					<td align='right'>
						<b>VillageName :</b>
					</td>
					<td>

						<select name="city" id="select">
							<c:choose>
								<c:when test="${requestScope.vill ne null}">
									<option value="${requestScope.vill}">
										${requestScope.vill}
									</option>
								</c:when>
								<c:otherwise>
									<option value="">
										--SELECT--
									</option>
								</c:otherwise>
							</c:choose>
							<c:if test="${not empty villages}">
								<c:forEach var="State" items="${villages}">
									<option value="${State.vname}">
										${State.vname}
									</option>
								</c:forEach>
							</c:if>
						</select>
					</td>
				</tr>

				<tr>
					<td align='right'>

						<b> Country :</b>

					</td>
					<td>
						<input type="text" name="country" value="INDIA" size="20" readonly />
					</td>
				</tr>


				<tr>
					<td align='right'>

						<b>Address Type :</b>

					</td>
					<td>
						<select name="addressType" onChange="cleartext()">
							<option value="select" selected="true">
								<font size="3" face="Verdana">Select </font>
							</option>
							<option value="home">
								<font size="3" face="Verdana">Home</font>
							</option>
							<option value="office">
								<font size="3" face="Verdana">Office</font>
							</option>
							<option value="personal">
								<font size="3" face="Verdana">Personal</font>
							</option>
						</select>
					</td>
				</tr>
				<tr>

					<td align='right'>

						<b>House No :</b>

					</td>
					<td>
						<input type="text" name="hno" value="" size="20" />
					</td>
				</tr>
				<tr>
					<td align='right'>

						<b>Street :</b>

					</td>
					<td>
						<input type="text" name="street" value="" size="20" />
					</td>
				</tr>

				<tr>
					<td align='right'>

						<b>Pin :</b>

					</td>
					<td>
						<input type="text" name="pin" value="" size="20"
							onChange="showStatus()" />
					</td>
				</tr>
				<tr>
					<td align='right'>

						<b>Phone Type :</b>

					</td>
					<td>
						<select name="phoneType">
							<option value="select" selected="true">
								<font size="3" face="Verdana">Select</font>
							</option>
							<option value="home">
								<font size="3" face="Verdana">Home</font>
							</option>
							<option value="office">
								<font size="3" face="Verdana">Office</font>
							</option>
							<option value="mobile">
								<font size="3" face="Verdana">Mobile</font>
							</option>
						</select>
					</td>
				</tr>
				<tr>
					<td align='right'>

						<b>Phone No :</b>

					</td>
					<td>
						<input type="text" name="phone" value="" size="20"
							onBlur="ValidateForm()" />
					</td>
				</tr>

				<tr>
					<input type="hidden" value="<%=p.getLoginID()%>" name="id">
					<input type="hidden" value="<%=p.getPassword()%>" name="password">
					<input type="hidden" value="<%=p.getLogintype()%>" name="logintype">
					<input type="hidden" value="<%=p.getSquest()%>" name="squest">
					<input type="hidden" value="<%=p.getOwnquest()%>" name="ownquest">
					<input type="hidden" value="<%=p.getSecretAnswer()%>"
						name="secretqans">
					<input type="hidden" value="<%=p.getFirstName()%>" name="firstname">
					<input type="hidden" value="<%=p.getLastName()%>" name="lastname">
					<input type="hidden" value="<%=p.getBirthDate()%>" name="bdate">
					<input type="hidden" value="<%=p.getEmail()%>" name="email">
					<input type="hidden" value="<%=p.getFax()%>" name="fax">
					<input type="hidden" value="<%=p.getPhoto()%>" name="photo">

					<td align='right'>
						<input type='Submit' value='Register' />
					</td>
					<td>
						<input type="reset" value="clear" />
					</td>
				</tr>
			</table>
		</form>

		<script language="JavaScript" type="text/javascript">
//You should create the validator only after the definition of the HTML form
  var frmvalidator  = new Validator("register");

  frmvalidator.addValidation("city","req","Village Name is required");
    frmvalidator.addValidation("city","alpha","Village Name is Only Characters");

  </script>
		<br />
		<jsp:include page="Footer.jsp"></jsp:include>
	</body>
</html>
